﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Common/MasterPages/Blank.Master" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="BaseInfoList.aspx.cs" Inherits="DMS.Web.Modules.ArchivesManagement.BaseInfoList" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="diy" %>
<%@ Register Src="~/Common/Controls/Loading.ascx" TagName="Loading" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="PageTitle" runat="server">
    基本信息
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="/Resources/Scripts/jquery.blockUI.js"></script>
    <script type="text/javascript" src="/Resources/Scripts/jquery-ui/ui/jquery.ui.core.min.js"></script>
	<script type="text/javascript" src="/Resources/Scripts/jquery-ui/ui/jquery.ui.widget.min.js"></script>
	<script type="text/javascript" src="/Resources/Scripts/jquery-ui/ui/jquery.ui.position.min.js"></script>
	<script type="text/javascript" src="/Resources/scripts/jquery-ui/ui/jquery.ui.mouse.min.js"></script>
    <script type="text/javascript" src="/Resources/scripts/jquery-ui/ui/jquery.ui.draggable.min.js"></script>
    <script type="text/javascript" src="/Resources/scripts/jquery-ui/ui/jquery.ui.button.min.js"></script>
    <script type="text/javascript" src="/Resources/scripts/jquery-ui/ui/jquery.ui.dialog.min.js"></script>
    <link rel="stylesheet" href="/Resources/Scripts/jquery-ui/themes/cupertino/jquery.ui.all.css">
    <%--<script type="text/javascript" src="/Resources/scripts/util.js"></script>--%>    
    <script type="text/javascript" language="javascript">
        var formType = '<%= FormType %>';
        function getClientIds() {
            return {
                Condition: '#<%= Condition.ClientID %>',
                btnSearch: '#<%= btnSearch.ClientID %>',
                exportBtn: '#<%= exportBtn.ClientID %>'
            };
        }

        $(document).ready(function () {
            $("#loading").dialog({
                resizable: false,
                height: 140,
                width: 110,
                modal: true,
                autoOpen: false,
                buttons: {

                }
            });

            $("#returnMessage").dialog({
                resizable: false,
                height: 320,
                width: 350,
                modal: true,
                autoOpen: false,
                title: "提示",
                buttons: {
                    "关闭": function () {
                        $(this).dialog("close");
                    }
                }
            });

            $('#gridviewDiv').height = document.documentElement.clientHeight;
        });
        
        function exportList() {
            window.open('/Resources/Templates/基本信息导入模板-单位.xls');
        }

        function deleteRecord(obj) {
            if (obj.id == 'hasChild') {
                alert('该基本信息下存在资料信息，无法删除！');
                return;
            }
            if (confirm('确定要删除该条记录？')) {
                $(obj).parents('tr').hide();
                alert('删除成功！');
            }
        }

        function GsCheck(obj) {
            if(obj.checked) {
                $('.fgs').hide();
                $('.gs').show();
            }else {
                $('.fgs').show();
                $('.gs').show();
            }

        }

        function searchForm() {
            $('#MainHolder_gvList tr').hide();
            $('.searchResult').show();
        }
    </script>
    <script type="text/javascript" src="/Modules/ArchivesManagement/Scripts/BaseInfoList.js"></script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainHolder" runat="server">        
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <asp:HiddenField ID="Condition" runat="server"/>
    <div id="mainareacontent" style="overflow:auto;padding-top:5px;">
            <div class="search">
                <!----------- 查询信息 ------------------>
                <span style="padding: 5 0 5 5"><b>当前列表：<asp:Label ForeColor="red" ID="currentListName" runat="server"></asp:Label></b></span>
                <table width="100%" cellpadding="0" cellspacing="0" style="padding: 5 0 5 5">
                    <tr>
                        <td class="form">
                            <table cellpadding="0" cellspacing="0" width="100%">
                                <tr>
                                    <th>
                                        档案盒编号：
                                    </th>
                                    <td>
                                        <asp:TextBox Height="22px" ID="txtBoxCode" runat="server" Width="150px"></asp:TextBox>
                                    </td>
                                    <th style="display:<%=DefaultDisplayStyle%>">
                                        单位社保号：
                                    </th>
                                    <th style="display:<%=GRDisplayStyle%>">
                                        个人社保号：
                                    </th>
                                    <td>
                                        <asp:TextBox Height="22px" ID="txtInsuranceCode" runat="server" Width="150px"></asp:TextBox>
                                    </td>
                                    <th>
                                        纳税编码：
                                    </th>
                                    <td>
                                        <asp:TextBox Height="22px" ID="txtTaxCode" runat="server" Width="150px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <th style="width: 100px">
                                         档案盒所在位置：
                                    </th>
                                    <td>
                                        <asp:TextBox ID="txtBoxPosition" runat="server" Width="150px"></asp:TextBox>
                                    </td>
                                    <th style="display:<%=DefaultDisplayStyle%>">
                                        单位名称：
                                    </th>
                                    <td style="display:<%=DefaultDisplayStyle%>">
                                        <asp:TextBox ID="txtUnitName" runat="server" Width="150px"></asp:TextBox>
                                    </td>
                                    <th style="display:<%=GRDisplayStyle%>">
                                        缴费人姓名：
                                    </th>
                                    <td style="display:<%=GRDisplayStyle%>">
                                        <asp:TextBox ID="txtPayerName" runat="server" Width="150px"></asp:TextBox>
                                    </td>
                                    <th>
                                        社保登记日期：
                                    </th>
                                    <td>
                                        <asp:TextBox ID="txtBeginRegistDate" onClick="WdatePicker()" runat="server" Width="70px"></asp:TextBox>
                                        至
                                        <asp:TextBox ID="txtEndRegistDate"  onClick="WdatePicker()" runat="server" Width="70px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        缴费单位类型：
                                    </th>
                                    <td>
                                        <asp:TextBox ID="txtPayUnitType" runat="server" Width="150px"></asp:TextBox>
                                    </td>
                                    <th>
                                        专管员：
                                    </th>
                                    <td>
                                        <asp:TextBox ID="txtAdmin" runat="server" Width="150px"></asp:TextBox>
                                    </td>
                                    <th style="display:<%=GRDisplayStyle%>">
                                        身份证号码：
                                    </th>
                                    <td style="display:<%=GRDisplayStyle%>">
                                        <asp:TextBox ID="txtIdentityCardNo" runat="server" Width="150px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        参保险种：
                                    </th>
                                    <td colspan="3">    
                                        <input id="cbYanglao" type="checkbox" style="width: 20px" runat="server" onclick="listSearch()"/><label for="<%=cbYanglao.ClientID %>">养老</label>
                                        <input id="cbGongshang" type="checkbox" style="width: 20px" runat="server"  onclick="listSearch()"/><label for="<%=cbGongshang.ClientID %>">工伤</label>
                                        <input id="cbShiye" type="checkbox" style="width: 20px" runat="server"  onclick="listSearch()"/><label for="<%=cbShiye.ClientID %>">失业</label>
                                        <input id="cbYiliao" type="checkbox" style="width: 20px" runat="server"  onclick="listSearch()"/><label for="<%=cbYiliao.ClientID %>">医疗</label>
                                        <input id="cbShengyu" type="checkbox" style="width: 20px" runat="server"  onclick="listSearch()" /><label for="<%=cbShengyu.ClientID %>">生育</label>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </div>
        <div align="left" style="padding: 5 0 0 0">
            <%--<span class="search"  style="padding: 2 0 2 2">
                <asp:CheckBox ID="CurrentPage" OnClick="CheckChange(this)" CssClass="checkboxGroup1" Text="全选当前页" runat="server"/>
                <asp:CheckBox ID="AllPage" OnClick="CheckChange(this)" CssClass="checkboxGroup2" Text="全选所有" runat="server"/>
            </span>--%>&nbsp;&nbsp;
            <%--<a onclick="searchForm();" id="MainHolder_btnSearch" class="linkbtn _searchBtn" href="#"><span>查询</span></a>--%>
            <asp:LinkButton CssClass="linkbtn _searchBtn" ID="btnSearch" OnClick="btnSearch_Click" runat="server"><span>查询</span></asp:LinkButton>
            <a class="linkbtn" href="javascript:exportData();"><span>数据导出</span></a>
            <asp:LinkButton CssClass="linkbtn" ID="uploadBtn" OnClientClick="uploadTemplate();return false;" runat="server"><span>数据导入</span></asp:LinkButton><%--onclick="ExportClick"--%>
            <a class="linkbtn" ID="addBtn"  runat="server" href="javascript:openForm('New','',formType);"><span>新增基本信息</span></a>
            <%--<asp:LinkButton CssClass="linkbtn" ID="LinkButton2" OnClientClick="openForm('New','');return false;" runat="server"><span>新增基本信息</span></asp:LinkButton><%--onclick="ExportClick"--%>
            <asp:LinkButton CssClass="linkbtn" ID="btnPrint" PostBackUrl="PrintLabels.aspx" runat="server"><span>打印标签</span></asp:LinkButton><%--OnClick="PrintClick"--%>
            <asp:LinkButton CssClass="linkbtn" ID="btnClear" OnClick="cleartemp_Click" runat="server"><span>清理临时空间</span></asp:LinkButton><%--OnClick="PrintClick"--%>
            <%--<asp:LinkButton CssClass="linkbtn" ID="LinkButton1" OnClientClick="javascript:feedBack();return false;"
                runat="server"><span>反馈</span></asp:LinkButton>
            <asp:LinkButton CssClass="linkbtn" ID="btnUrge" OnClientClick="javascript:urgeOrder();return false;"
                runat="server"><span>催办</span></asp:LinkButton>
            <asp:LinkButton CssClass="linkbtn" ID="btnComplain" OnClientClick="javascript:complain();return false;" runat="server"><span>投诉</span></asp:LinkButton>
            <asp:LinkButton CssClass="linkbtn" ID="btnComplainReply" OnClientClick="javascript:complainReply();return false;" Visible="false" runat="server"><span>投诉回复</span></asp:LinkButton>
            <asp:LinkButton CssClass="linkbtn" ID="btnChange" OnClientClick="javascript:changeSupplier();return false;" runat="server"><span>转单</span></asp:LinkButton>--%>
            
            <asp:LinkButton CssClass="linkbtn" ID="btnDelayReply" OnClientClick="javascript:delayReply();return false;" Visible="false" runat="server"><span>超时回复</span></asp:LinkButton>
            <asp:LinkButton CssClass="linkbtn" ID="btnExceptionReply" OnClientClick="javascript:delayReply('exception');return false;" Visible="false" runat="server"><span>异常反馈</span></asp:LinkButton>
            <%--<asp:LinkButton CssClass="linkbtn _searchBtn" ID="btnFeedback" OnClientClick="return CheckIsAllSelect();" OnClick="FeedbackClick" runat="server"><span>回填运单号</span></asp:LinkButton>--%>
            
        </div>
        <div id="gridviewDiv" style="overflow-x:auto;overflow-y:auto;width:100%;height: 390px">


            <!----------- 数据列表 ------------------>
            <asp:GridView ID="baseInfoList" runat="server" class="dg_borderstyle" AutoGenerateColumns="False" 
                CellPadding="0" CellSpacing="1" border="0" ShowHeaderWhenEmpty="true" OnRowCommand="DealCommand" 
                AlternatingRowStyle-CssClass="dg_alternatingitemstyle" AllowSorting="True" OnSorting="GridView1_Sorting"
                RowStyle-CssClass="dg_itemstyle" onrowdatabound="baseInfoList_RowDataBound" Width="950px">
                <HeaderStyle CssClass="dg_headerstyle"></HeaderStyle>
                <Columns>
                    <asp:BoundField DataField="BaseInfoID" HeaderText="基本资料编号" Visible="false"/>
                    <asp:TemplateField Visible="false">
                        <ItemTemplate>
                            <input id="chkItem" class="_selectItem" runat="server" type="checkbox" value='<%# DataBinder.Eval(Container, "DataItem.BaseInfoID").ToString()%>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:HyperLinkField ItemStyle-Wrap="False" HeaderStyle-Wrap="False" DataNavigateUrlFields="BaseInfoID,Type" DataNavigateUrlFormatString="/Modules/ArchivesManagement/BaseInfoForm.aspx?id={0}&action=View&baseInfoType={1}"
                        DataTextField="BoxCode" HeaderText="档案盒编号" Target="_blank" SortExpression="BoxCode"/>
                    <asp:BoundField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" DataField="BoxPosition" HeaderText="所在位置" SortExpression="BoxPosition"/>

                    <asp:BoundField ItemStyle-Wrap="False" HeaderStyle-Wrap="False" DataField="InsuranceCode" HeaderText="单位社保号" SortExpression="InsuranceCode"/>                    
                    <asp:BoundField ItemStyle-Wrap="False" HeaderStyle-Wrap="False"  DataField="UnitName" HeaderText="单位名称" SortExpression="UnitName"/>
                    
                    <asp:BoundField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" DataField="InsuranceCode" HeaderText="个人社保号" SortExpression="InsuranceCode" Visible="False"/>
                    <asp:BoundField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" DataField="PayerName" HeaderText="缴费人姓名" SortExpression="PayerName" Visible="False"/>
                    <asp:TemplateField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" HeaderText="电话号码">
                        <ItemTemplate>
                           <%# Eval("Mobile")+((string.IsNullOrEmpty(Eval("Mobile").ToString())||string.IsNullOrEmpty(Eval("Phone").ToString()))?"":"、")+Eval("Phone") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" DataField="IdentityCardNo" HeaderText="身份证号码" SortExpression="IdentityCardNo" Visible="False"/>
                    
                    <asp:BoundField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" DataField="TaxCode" HeaderText="纳税编码" SortExpression="TaxCode"/>
                    <asp:BoundField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" DataField="PayUnitType" HeaderText="缴费单位类型" SortExpression="PayUnitType"/>
                    <asp:BoundField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" DataField="RegistDate" HeaderText="登记日期" DataFormatString="{0:yyyy-MM-dd}" HtmlEncode="False" SortExpression="RegistDate"/>
                    <asp:BoundField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" DataField="InsuranceCount" HeaderText="人数" />
                    <asp:TemplateField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" HeaderText="参保险种">
                        <ItemTemplate>
                            <asp:Label ID="InsuranceType" runat="server"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Admin"  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" HeaderText="专管员" SortExpression="Admin"/>
                   
                    <asp:TemplateField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" HeaderText="操作">
                        <ItemTemplate>
                            <a href='<%#"javascript:openForm(\"Edit\",\"" + Eval("BaseInfoID") + "\",\""+ Eval("Type")+"\")"%>'><span>编辑</span></a>
                            <asp:LinkButton CommandArgument='<%#Eval("BaseInfoID") %>' OnClientClick="return deleteConfirm();" CommandName="DeleteBaseInfo" runat="server" ID="btnDelete"><span>删除</span></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <!--分页-->
            <table width="100%">
                <tr>                    
                    <td Width="85%">
                        <diy:AspNetPager ID="pager" runat="server" AlwaysShow="true" OnPageChanged="pager_PageChanged"
                            Width="100%" ShowPageIndexBox="Always" PageIndexBoxType="TextBox" TextBeforePageIndexBox="转到"
                            TextAfterPageIndexBox="页" ShowCustomInfoSection="Left" CustomInfoHTML="总数：%RecordCount%，共 %PageCount% 页，当前为第%CurrentPageIndex%页"
                            HorizontalAlign="right" FirstPageText="首页" PrevPageText="上页" NextPageText="下页"
                            LastPageText="末页" CssClass="dg_pagestyle" PageSize="15">
                        </diy:AspNetPager>    
                    </td>
                    <td Width="15%">，每页<asp:TextBox ID="PageSize" runat="server" style="width: 30px" Text="15" onblur="CheckPageSize(this)"></asp:TextBox>条记录。</td>
                </tr>
            </table>
            <br/>
            </div>

            <div id="loading" style="display:none">
	            <table><tr><td><img src='/Themes/Default/images/loading.gif'/></td>
                <td style="word-break:keep-all; background-color:">数据处理中...</td></tr>
                </table>
            </div>
            <div id="returnMessage" style="display:none;">
                <div style="width:100%;height: 320px"><span id="messageContent"> </span></div>
            </div>
    </div>
    </ContentTemplate>
    <Triggers>
        <%--<asp:PostBackTrigger ControlID="lbtnAddMember" />
        <asp:PostBackTrigger ControlID="lbtnExport" />--%>
    </Triggers>
    </asp:UpdatePanel>             
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"
        DynamicLayout="true">
        <ProgressTemplate>
            <uc1:Loading ID="Loading1" runat="server" />
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:LinkButton CssClass="linkbtn" ID="exportBtn" OnClick="ExportClick" runat="server" style="display: none"><span>数据导出</span></asp:LinkButton>
</asp:Content>
